/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.powertalk3.server.DAO;

import cn.powertalk3.server.util.HibernateUtil;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author mrgaolei
 */
public abstract class BaseDAO {

	protected Session session;

	public BaseDAO() {
		session = HibernateUtil.getSessionFactory().openSession();
	}

	public void save(Object obj) {
		Transaction trans = this.session.beginTransaction();
		this.session.save(obj);
		trans.commit();
	}
}
